package br.com.marcelo.reservasis.domain.model;

import br.com.aroeirasoftware.gwtcomponents.domain.models.ASBaseEntity;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Kirmaier
 */
@Entity
@Table(name = "Hospede")
//@NamedQueries({@NamedQuery(name = "Hospede.findAll", query = "SELECT h FROM Hospede h"), @NamedQuery(name = "Hospede.findByIdhospede", query = "SELECT h FROM Hospede h WHERE h.idhospede = :idhospede"), @NamedQuery(name = "Hospede.findByNome", query = "SELECT h FROM Hospede h WHERE h.nome = :nome"), @NamedQuery(name = "Hospede.findByCpf", query = "SELECT h FROM Hospede h WHERE h.cpf = :cpf"), @NamedQuery(name = "Hospede.findByIdentidade", query = "SELECT h FROM Hospede h WHERE h.identidade = :identidade"), @NamedQuery(name = "Hospede.findByTelefone", query = "SELECT h FROM Hospede h WHERE h.telefone = :telefone"), @NamedQuery(name = "Hospede.findByEndereco", query = "SELECT h FROM Hospede h WHERE h.endereco = :endereco")})
public class Hospede extends ASBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "Id_hospede")
    private Integer idhospede;
    @Basic(optional = false)
    @Column(name = "Nome")
    private String nome;
    @Column(name = "CPF")
    private String cpf;
    @Column(name = "Identidade")
    private String identidade;
    @Column(name = "Telefone")
    private String telefone;
    @Column(name = "Endereco")
    private Integer endereco;
    @OneToMany(mappedBy = "hospede")
    private Set<ReservaEstadia> reservasEstadias;

    public Hospede() {
    }

    public Hospede(Integer idhospede) {
        this.idhospede = idhospede;
    }

    public Hospede(Integer idhospede, String nome) {
        this.idhospede = idhospede;
        this.nome = nome;
    }

    public Integer getIdhospede() {
        return idhospede;
    }

    public void setIdhospede(Integer idhospede) {
        this.idhospede = idhospede;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }

    public String getIdentidade() {
        return identidade;
    }

    public void setIdentidade(String identidade) {
        this.identidade = identidade;
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public Integer getEndereco() {
        return endereco;
    }

    public void setEndereco(Integer endereco) {
        this.endereco = endereco;
    }

    public Set<ReservaEstadia> getReservasEstadias() {
        return reservasEstadias;
    }

    public void setReservasEstadias(Set<ReservaEstadia> reservasEstadias) {
        this.reservasEstadias = reservasEstadias;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idhospede != null ? idhospede.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hospede)) {
            return false;
        }
        Hospede other = (Hospede) object;
        if ((this.idhospede == null && other.idhospede != null) || (this.idhospede != null && !this.idhospede.equals(other.idhospede))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.reservasis.Hospede[idhospede=" + idhospede + "]";
    }
}
